<template>
    <div class="newsmanageIndex">  
        <p>{{this.topic}}</p> 
        <button class="bbutton" @click="returntM" style="float:right" >返回上一级</button>
        <el-table ref="table" :data="tableData" > 
            <el-table-column prop="news_id" label="id" width="180"> </el-table-column>
            <el-table-column prop="title" label="标题" width="180"> </el-table-column>
            <el-table-column prop="content" label="内容" width=400 :show-overflow-tooltip='true'> 
            </el-table-column>
            <el-table-column label="操作">
                <template slot-scope="scope">
                    <el-button
                    size="mini"
                    @click="detailnews(scope.$index, scope.row)">查看详情</el-button>
                </template>
            </el-table-column>
        </el-table>
    </div>
</template>

<script>
export default {
     data() {
        var tmptopic = this.$route.query.specialtopic
        var tmptabledata = this.$route.query.news_list
        return {
            tableData:tmptabledata,
            topic:tmptopic
        }
    },
    methods:{
        detailnews(index, row){
            const self = this;            
            this.$router.push({
                name:'NewsScan',
                query:{
                    id:row.news_id,
                    title: row.title,
                    source: row.source,
                    url: row.url,
                    publish_time:row.publish_time,
                    category:row.category,
                    content:row.content,
                    keywords:row.keywords,
                    sentiment:row.sentiment
                }
            })
        },
        returntM(){
            this.$router.push({
                name:'topicManagement',
                query:{
                }
            })
        }
    }
}
</script>